<?php
/**
 * 用户进店统计
 */

namespace app\services;

use app\admin\controller\ApiCommon;
use app\crm\logic\WhereLogic;
use app\crm\model\Customer;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Db;

class CustomerEnterShop
{
    /**
     * @throws DataNotFoundException
     * @throws ModelNotFoundException
     * @throws DbException
     */
    public function index($condition): array
    {
        $page = isset($condition['page']) && intval($condition['page']) ? intval($condition['page']) : 1;
        $pageSize = isset($condition['limit']) && intval($condition['limit']) ? intval($condition['limit']) : 15;
        $user_id = $condition['user_id'] ?? 0;
        //实例化搜索工具
        $whereLogic = new WhereLogic();

        //初始化设置搜索的店铺集
        $whereLogic->setWhereSearch($condition);
        //疤痕搜索
        $scarId = $condition['scar_id'] ?? 0;
        $whereType = [];
        $whereType['customer_name'] = 'like';
        $whereType['source_id'] = '=';
        $whereType['membership_leve'] = '=';
        $whereType['member_classification'] = '=';
        $whereType['repair_progress'] = '=';
        $whereType['age'] = '=';
        $whereType['telephone'] = '=';
        $whereLogic->setWhereType($whereType);
        $where = $whereLogic->getWhere($condition, $whereType);
        if (!empty($condition['create_time'])) {
            $where[] = ['create_time', '>=', strtotime($condition['create_time'] . ' 00:00:00')];
            $where[] = ['create_time', '<=', strtotime($condition['create_time'] . ' 23:59:59')];
        }
        if (!empty($condition['shop_id']) && intval($condition['shop_id'])) {
            $where[] = ['shop_id', '=', $condition['shop_id']];
        }
        if (!empty($condition['nurse_id']) && intval($condition['nurse_id'])) {
            $where[] = ['nurse_id', '=', $condition['nurse_id']];
        }
        //查询该员工的 查询权限和客户档案
        $userList = Db::name('admin_user')->alias('u')
            ->join('shop_person s', 'u.shop_person_id=s.id', 'LEFT')
            ->where('u.id', '=', $user_id)
            ->where('u.is_status', '=', 0)
            ->column('u.type,u.structure_name,u.structure_id,u.shop_person_id,s.position_id');
        //判断店面护理师 只能查看自己名下的 客户档案
        if ($userList[0]['type'] == 3 && $userList[0]['position_id'] == '9') {
            $where[] = ['nurse_id', '=', $userList[0]['shop_person_id']];
        }
        $consumption_min = '';
        if (isset($condition['consumption_min']) && is_numeric($condition['consumption_min'])) {
            $consumption_min = $condition['consumption_min'];
        }
        if ($consumption_min !== '') {
            $where[] = ['consumption', '>=', $consumption_min];
        }
        $consumption_max = '';
        if (isset($condition['consumption_max']) && is_numeric($condition['consumption_max'])) {
            $consumption_max = $condition['consumption_max'];
        }
        if ($consumption_max !== '') {
            $where[] = ['consumption', '<=', $consumption_max];
        }
        // 年龄搜索
        $ageMin = $condition['agemin'] ?? '';
        if ($ageMin !== '') {
            $where[] = ['age', '>=', $ageMin];
        }
        $ageMax = $condition['agemax'] ?? '';
        if ($ageMax !== '') {
            $where[] = ['age', '<=', $ageMax];
        }
        $sex = $condition['sex'] ?? 0;
        if (!empty($sex)) {
            $where[] = ['sex', '=', $sex];
        }
        $isNewOrder = $condition['isNewOrder'] ?? 0;
        if ($isNewOrder) {
            $where[] = ['cj_time', '>', 0];
            $where[] = ['cj_money', '>=', 500];
            $where[] = ['final_consumption|final_service', '>', '0']; //非活跃顾客 --之前老顾客
        }

        $member_status = $condition['huiyuan_status'] ?? 0;

        //会员过期时间
        $member_expire_time = 24 * 60 * 60 * 30;
        if ($member_status == 1) {
            $where[] = ['be_overdue_time', '<', time()];
        } else if ($member_status == 2) {
            $where[] = ['be_overdue_time', '>', time()];
        } else if ($member_status == 3) {
            $where[] = ['be_overdue_time', '<=', time() + $member_expire_time];
            $where[] = ['be_overdue_time', '>', time()];
        }

        //客户标签
        $member_label = $condition['member_label'] ?? 0;
        if ($member_label > 0) {
            $where[] = ['member_label', 'like', '%' . $member_label . '%'];
        }

        //成交时间
        $cj_time = $condition['cj_time'] ?? '';
        if ($cj_time) {
            $where[] = ['cj_time', '>=', strtotime(date('Y-m-d', strtotime($cj_time)) . '00:00:00')];
        }

        $cj_end_time = $condition['cj_endtime'] ?? '';
        if ($cj_end_time) {

            $where[] = ['cj_time', '<=', strtotime(date('Y-m-d', strtotime($cj_end_time)) . '23:59:59')];

        }

        $is_join_shop = $condition['is_join_shop'] ?? 0;
        if ($is_join_shop == 1) {
            $where[] = ['first_time', '>', 0];
        } else if ($is_join_shop == 2) {
            $where[] = ['membership_leve', '>', 0];
        } else if ($is_join_shop == 3 || $is_join_shop == 4) {//流失-预警
            $bei = $is_join_shop == 3 ? 4 : 1;
            if ($is_join_shop == 3) {
                $where[] = ['month4', '=', 4];
            } else {
                $where[] = ['month1', '=', 1];
            }
            $jzxzTime = strtotime("2022-01-01");
            $where[] = ['cj_time', '>', $jzxzTime];

            $where[] = ['cj_time', '>', $jzxzTime];

            $shopIdmz = [73782775131388, 73782774881835, 73782775392774, 73782775377728, 73782775206631, 73782775085647, 73782774991693];

            $where[] = ['shop_id', 'not in', $shopIdmz];
        }

        $shopWhere = [];
        $type = $condition['type'] ?? [];
        if ($type) {
            $shopWhere[] = ['type', '=', $type];
        }

        $shopIds = $condition['shopIds'] ?? [];

        if ($shopIds) {
            $shopWhere[] = ['shop_id', 'in', $shopIds];
        }

        $marketId = $condition['market_id'] ?? "";

        if ($marketId) {
            $shopWhere[] = ['market_id', '=', $marketId];
        }

        $shopList = Db::name('shop')->where($shopWhere)->column('shop_id');

        if (!empty($shopList)) {
            $where[] = ['shop_id', 'in', $shopList];
        }
        $turn_status = $condition['turn_status'] ?? 0;
        if ($turn_status == 1) {
            $where[] = ['turn_status', '=', 1];
        }

        $first_time_start = $condition['first_time_start'] ?? '';
        $first_time_end = $condition['first_time_end'] ?? '';
        $create_time_start = empty($condition['create_time_start']) ? 0 : strtotime($condition['create_time_start']);
        if ($create_time_start > 0) {
            $where[] = ['create_time', '>=', $create_time_start];
        }
        $create_time_end = empty($condition['create_time_end']) ? 0 : strtotime($condition['create_time_end']);
        if ($create_time_end > 0) {
            $where[] = ['create_time', '<=', $create_time_end];
        }
        $last_kftime_start = empty($condition['last_kftime_start']) ? 0 : strtotime($condition['last_kftime_start']);
        if ($last_kftime_start > 0) {
            $where[] = ['last_kftime', '>=', $last_kftime_start];
        }
        $last_kftime_end = empty($condition['last_kftime_end']) ? 0 : strtotime($condition['last_kftime_end']);
        if ($last_kftime_end > 0) {
            $where[] = ['last_kftime', '<=', $last_kftime_end];
        }
        $customer_service_name = $condition['customer_service_name'] ?? 0;
        if (!empty($customer_service_name)) {
            $ids = Db::name('admin_user')->where('realname', 'like', '%' . $customer_service_name . '%')->column('id');
            $where[] = ['operator', 'in', $ids];
        }
        $difficulty_level = $condition['difficulty_level'] ?? 0;
        if ($difficulty_level) {
            $where[] = ['difficulty_level', '=', $difficulty_level];
        }
        $effective_entry = $condition['effective_entry'] ?? 0;
        if ($effective_entry == 1) {
            $where[] = ['first_time', '>', 0];
        } else if ($effective_entry == 2) {
            $where[] = ['first_time', '=', 0];
        }
        $where2 = $where;
        $customer_name_phone = $condition['customer_name_phone'] ?? '';
        $customerModel = new Customer();
        $dataCounts = $customerModel->where($where)
            ->where(function ($query) use ($customer_name_phone) {
                if (!empty($customer_name_phone)) {
                    $query->where('customer_name', 'like', '%' . $customer_name_phone . '%');
                    $query->whereOr('telephone', '=', $customer_name_phone);
                }
            })
            ->where(function ($query) use ($first_time_start, $first_time_end) {
                $firstWhere = [];
                $secondWhere = [];
                $first_time_start = empty($first_time_start) ? 0 : strtotime($first_time_start);
                if ($first_time_start > 0) {
                    $firstWhere[] = ['first_time', '>=', $first_time_start];
                    $secondWhere[] = ['second_time', '>=', $first_time_start];
                }
                $first_time_end = empty($first_time_end) ? 0 : strtotime($first_time_end);
                if ($first_time_end > 0) {
                    $firstWhere[] = ['first_time', '<=', $first_time_end];
                    $secondWhere[] = ['second_time', '<=', $first_time_end];
                }
                if (!empty($firstWhere)) {
                    $query->where(function ($query) use ($firstWhere) {
                        $query->where($firstWhere);
                    });
                    $query->whereOr(function ($query) use ($secondWhere) {
                        $query->where($secondWhere);
                    });
                }
            });
        if (!empty($scarId)) {
            $dataCounts = $dataCounts->where('id', 'IN', function ($query) use ($scarId) {
                $query->table('xy_customer_scar')->where('customer_setting_id_type', '=', $scarId)->field('customer_id');
            });
        }
        $dataCounts = $dataCounts->count();
        if ($dataCounts) {
            $field = ['id', 'customer_name', 'sex', 'telephone', 'birthday', 'shop_id', 'source_id', 'effective_entry', 'status', 'create_time', 'first_time', 'second_time', 'member_classification', 'turn_status', 'age', 'membership_leve', 'nurse_id', 'repair_progress', 'consumption', 'new_join_shop_time', 'final_consumption', 'final_service', 'join_time', 'be_overdue_time', 'cj_time', 'cj_money', 'operator', 'last_kftime', 'difficulty_level,introducer'];
            if ($is_join_shop == 1) {
                $orderBy = 'new_join_shop_time DESC';
            } else if ($is_join_shop == 2) {
                $orderBy = 'join_time DESC';
            } else {
                $orderBy = 'id DESC';
            }
            if ($is_join_shop == 1) {
                $orderBy = 'first_time DESC';
            }
            if ($is_join_shop == 7) {
                $orderBy = 'cj_time DESC';
            }

            $list = $customerModel->where($where)
                ->where(function ($query) use ($customer_name_phone) {
                    if (!empty($customer_name_phone)) {
                        $query->where('customer_name', 'like', '%' . $customer_name_phone . '%');
                        $query->whereOr('telephone', '=', $customer_name_phone);
                    }
                })
                ->where(function ($query) use ($first_time_start, $first_time_end) {
                    $firstWhere = [];
                    $secondWhere = [];
                    $first_time_start = empty($first_time_start) ? 0 : strtotime($first_time_start);
                    if ($first_time_start > 0) {
                        $firstWhere[] = ['first_time', '>=', $first_time_start];
                        $secondWhere[] = ['second_time', '>=', $first_time_start];
                    }
                    $first_time_end = empty($first_time_end) ? 0 : strtotime($first_time_end);
                    if ($first_time_end > 0) {
                        $firstWhere[] = ['first_time', '<=', $first_time_end];
                        $secondWhere[] = ['second_time', '<=', $first_time_end];
                    }
                    if (!empty($firstWhere)) {
                        $query->where(function ($query) use ($firstWhere) {
                            $query->where($firstWhere);
                        });
                        $query->whereOr(function ($query) use ($secondWhere) {
                            $query->where($secondWhere);
                        });
                    }
                });
            if (!empty($scarId)) {
                $list = $list->where('id', 'IN', function ($query) use ($scarId) {
                    $query->table('xy_customer_scar')->where('customer_setting_id_type', '=', $scarId)->field('customer_id');
                });
            }
            $list = $list->field($field)->order($orderBy)
                ->limit(($page - 1) * $pageSize, $pageSize)
                ->select()->toArray();
            $shopId = array_values(array_unique(array_column($list, 'shop_id')));
            $nurseId = array_values(array_unique(array_column($list, 'nurse_id')));
            $operatorIds = array_values(array_unique(array_column($list, 'operator')));
            $introducerId = array_values(array_unique(array_column($list, 'introducer')));
            $telephone = array_values(array_unique(array_column($list, 'telephone')));
            //获取店铺数据
            $shopList = Db::name('shop')->where('shop_id', 'in', $shopId)->column('shop_name,market_name', 'shop_id');
            //获取员工数据
            $personList = Db::name('shop_person')->where('id', 'in', $nurseId)->column('name', 'id');
            //获取会员等级
            $gradeList = Db::name('customer_grade')->column('name', 'id');
            $adminList = Db::name('admin_user')->where('id', 'in', $operatorIds)->column('realname', 'id');
            //转介绍人
            $shopPerson = Db::name('shop_person')->where('id', 'in', $introducerId)->column('name', 'id');
            //总金额
            $sumMoney = Db::name('customer')->where('telephone', 'in', $telephone)->where('status', '=', 1)->group('telephone')->column('sum(consumption)', 'telephone');
            //基础配置
            $settingList = Db::name('setting')->column('name', 'id');
            $sexArr = ['0' => '未知', '1' => '男', '2' => '女'];
            $EntryArr = ['1' => '是', '2' => '否'];
            //疤痕初始化搜索
            foreach ($list as $key => $val) {
                if ($val['birthday']) {
                    $setData = [];
                    $setData['age'] = bcsub(date('Y'), date('Y', $val['birthday']));
                    $setData['id'] = $val['id'];
                    $list[$key]['age'] = $setData['age'];
                }
            }

            foreach ($list as $key => $val) {
                $list[$key]['sex'] = $sexArr[$val['sex']] ?? '未知';
                $list[$key]['effective_entry'] = $EntryArr[$val['effective_entry']] ?? '否';
                $list[$key]['shop_name'] = $shopList[$val['shop_id']]['shop_name'] ?? '';
                $list[$key]['market_name'] = $shopList[$val['shop_id']]['market_name'] ?? '';
                $list[$key]['birthday'] = $val['birthday'] ? date('Y-m-d', $val['birthday']) : '';
                $list[$key]['source_name'] = $settingList[$val['source_id']] ?? '';
                // 进店-进店时间-进店状态1未进店2已进店
                $list[$key]['first_time'] = $val['first_time'] ? date('Y-m-d H:i', $val['first_time']) : '';
                $list[$key]['new_join_shop_time'] = $list[$key]['first_time']; // 首次进店时间

                $list[$key]['second_time'] = $val['second_time'] ? date('Y-m-d H:i', $val['second_time']) : '';
                $list[$key]['second_join_shop_time'] = $list[$key]['second_time']; // 二次进店时间

                $list[$key]['final_consumption'] = $val['final_consumption'] ? date('Y-m-d H:i', $val['final_consumption']) : '';
                $list[$key]['final_service'] = $val['final_service'] ? date('Y-m-d H:i', $val['final_service']) : '';
                $list[$key]['last_kftime'] = $val['last_kftime'] ? date('Y-m-d H:i', $val['last_kftime']) : '';
                $list[$key]['join_time'] = $val['join_time'] ? date('Y-m-d H:i:s', $val['join_time']) : '';
                if ($val['be_overdue_time'] > 0) {
                    if ($val['be_overdue_time'] > time()) {
                        $list[$key]['huiyuan_status'] = '生效中';
                        if (($val['be_overdue_time'] - $member_expire_time) <= time()) {
                            $list[$key]['huiyuan_status'] = '即将过期';

                        }
                    } else {
                        $list[$key]['huiyuan_status'] = '已过期';
                    }
                } else {
                    $list[$key]['huiyuan_status'] = '非会员';
                }
                $list[$key]['be_overdue_time'] = $val['be_overdue_time'] ? date('Y-m-d H:i', $val['be_overdue_time']) : '';
                $list[$key]['first_status'] = $val['first_time'] ? '1' : '2';
                // 会员分类-分类id-分类名称
                $list[$key]['class_name'] = $settingList[$val['member_classification']] ?? '';
                // 会员等级
                $list[$key]['grade_name'] = $gradeList[$val['membership_leve']] ?? '';
                // 负责人名称
                $list[$key]['nurse_name'] = $personList[$val['nurse_id']] ?? '';
                // 转介绍人
                $list[$key]['introducer'] = $shopPerson[$val['introducer']] ?? '';
                // 修复进展
                $list[$key]['progress_name'] = $settingList[$val['repair_progress']] ?? '';
                //门店+门诊
                $list[$key]['sum_money'] = $sumMoney[$val['telephone']] ?? 0.00;
                // 客户疤痕内容
                $whereLogic->setWhereType($whereType);
                $where = $whereLogic->getWhere($condition, $whereType);
                $dataCount = $customerModel->where($where)->count();
                $scarList = Db::name('customer_scar')
                    ->where('customer_id', '=', $val['id'])
                    ->group('customer_setting_id_type')
                    ->select()->toArray();
                $scar_aggregate = '';
                if ($scarList) {
                    $typeIdArr = array_column($scarList, 'customer_setting_id_type');
                    foreach ($typeIdArr as $typeK => $typeV) {
                        $str = $settingList[$typeV] ?? '';
                        $scar_aggregate .= $str . ',';
                    }
                }
                $list[$key]['scar_aggregate'] = $scar_aggregate;
                // 客户的名称
                $list[$key]['customer_service_name'] = $adminList[$val['operator']] ?? '';
                // 成交时间
                $list[$key]['cj_time'] = $val['cj_time'] ? date('Y-m-d H:i:s', $val['cj_time']) : '';
                $list[$key]['cj_money'] = $val['cj_money'];
                $list[$key]['customer_name_phone'] = $val['customer_name'] . '/' . $val['telephone'];
            }

        }

        /**总数统计**/
        if($dataCounts > 0){
            $cjNum = $customerModel->where($where2)->where('member_classification','=',73)->where(function ($query) use ($customer_name_phone) {
                if(!empty($customer_name_phone)){
                    $query->where('customer_name', 'like', '%'.$customer_name_phone.'%');
                    $query->whereOr('telephone', '=', $customer_name_phone);
                }
            })->where(function ($query) use ($first_time_start,$first_time_end) {
                $firstWhere = [];
                $secondWhere = [];
                $first_time_start = empty($first_time_start) ? 0 : strtotime($first_time_start);
                if($first_time_start > 0){
                    $firstWhere[] = ['first_time', '>=', $first_time_start];
                    $secondWhere[] = ['second_time', '>=', $first_time_start];
                }
                $first_time_end = empty($first_time_end) ? 0 : strtotime($first_time_end);
                if($first_time_end){
                    $firstWhere[] = ['first_time', '<=', $first_time_end];
                    $secondWhere[] = ['second_time', '<=', $first_time_end];
                }
                if(!empty($firstWhere)){
                    $query->where(function ($query) use ($firstWhere){
                        $query->where($firstWhere);
                    });
                    $query->whereOr(function ($query) use ($secondWhere){
                        $query->where($secondWhere);
                    });
                }
            })->count() ?? 0;
            $yzNum = $customerModel->where($where2)->where('member_classification','=',72)->where(function ($query) use ($customer_name_phone) {
                if(!empty($customer_name_phone)){
                    $query->where('customer_name', 'like', '%'.$customer_name_phone.'%');
                    $query->whereOr('telephone', '=', $customer_name_phone);
                }
            })->where(function ($query) use ($first_time_start,$first_time_end) {
                $firstWhere = [];
                $secondWhere = [];
                $first_time_start = empty($first_time_start) ? 0 : strtotime($first_time_start);
                if($first_time_start > 0){
                    $firstWhere[] = ['first_time', '>=', $first_time_start];
                    $secondWhere[] = ['second_time', '>=', $first_time_start];
                }
                $first_time_end = empty($first_time_end) ? 0 : strtotime($first_time_end);
                if($first_time_end > 0){
                    $firstWhere[] = ['first_time', '<=', $first_time_end];
                    $secondWhere[] = ['second_time', '<=', $first_time_end];
                }
                if(!empty($firstWhere)){
                    $query->where(function ($query) use ($firstWhere){
                        $query->where($firstWhere);
                    });
                    $query->whereOr(function ($query) use ($secondWhere){
                        $query->where($secondWhere);
                    });
                }
            })->count() ?? 0;
            $ptNum = $customerModel->where($where2)->where('member_classification','=',71)->where(function ($query) use ($customer_name_phone) {
                if(!empty($customer_name_phone)){
                    $query->where('customer_name', 'like', '%'.$customer_name_phone.'%');
                    $query->whereOr('telephone', '=', $customer_name_phone);
                }
            })->where(function ($query) use ($first_time_start,$first_time_end) {
                $firstWhere = [];
                $secondWhere = [];
                $first_time_start = empty($first_time_start) ? 0 : strtotime($first_time_start);
                if($first_time_start > 0){
                    $firstWhere[] = ['first_time', '>=', $first_time_start];
                    $secondWhere[] = ['second_time', '>=', $first_time_start];
                }
                $first_time_end = empty($first_time_end) ? 0 : strtotime($first_time_end);
                if($first_time_end > 0){
                    $firstWhere[] = ['first_time', '<=', $first_time_end];
                    $secondWhere[] = ['second_time', '<=', $first_time_end];
                }
                if(!empty($firstWhere)){
                    $query->where(function ($query) use ($firstWhere){
                        $query->where($firstWhere);
                    });
                    $query->whereOr(function ($query) use ($secondWhere){
                        $query->where($secondWhere);
                    });
                }
            })->count() ?? 0;
            $zcNum = $customerModel->where($where2)->where('member_classification','=',70)->where(function ($query) use ($customer_name_phone) {
                if(!empty($customer_name_phone)){
                    $query->where('customer_name', 'like', '%'.$customer_name_phone.'%');
                    $query->whereOr('telephone', '=', $customer_name_phone);
                }
            })->where(function ($query) use ($first_time_start,$first_time_end) {
                $firstWhere = [];
                $secondWhere = [];
                $first_time_start = empty($first_time_start) ? 0 : strtotime($first_time_start);
                if($first_time_start > 0){
                    $firstWhere[] = ['first_time', '>=', $first_time_start];
                    $secondWhere[] = ['second_time', '>=', $first_time_start];
                }
                $first_time_end = empty($first_time_end) ? 0 : strtotime($first_time_end);
                if($first_time_end){
                    $firstWhere[] = ['first_time', '<=', $first_time_end];
                    $secondWhere[] = ['second_time', '<=', $first_time_end];
                }
                if(!empty($firstWhere)){
                    $query->where(function ($query) use ($firstWhere){
                        $query->where($firstWhere);
                    });
                    $query->whereOr(function ($query) use ($secondWhere){
                        $query->where($secondWhere);
                    });
                }
            })->count() ?? 0;
            $statisticsData = [
                'allnum'=>$dataCounts,
                'cj'=>[
                    'num'=>$cjNum,
                    'zhanbi'=>bcmul(bcdiv($cjNum,$dataCounts,2),100,2).'%'
                ],
                'yz'=>[
                    'num'=>$yzNum,
                    'zhanbi'=>bcmul(bcdiv($yzNum,$dataCounts,2),100,2).'%'
                ],
                'pt'=>[
                    'num'=>$ptNum,
                    'zhanbi'=>bcmul(bcdiv($ptNum,$dataCounts,2),100,2).'%'
                ],
                'zc'=>[
                    'num'=>$zcNum,
                    'zhanbi'=>bcmul(bcdiv($zcNum,$dataCounts,2),100,2).'%'
                ],
            ];
        }else{
            $statisticsData = [
                'allnum'=>0,
                'cj'=>[
                    'num'=>0,
                    'zhanbi'=>'0%'
                ],
                'yz'=>[
                    'num'=>0,
                    'zhanbi'=>'0%'
                ],
                'pt'=>[
                    'num'=>0,
                    'zhanbi'=>'0%'
                ],
                'zc'=>[
                    'num'=>0,
                    'zhanbi'=>'0%'
                ],
            ];
        }

        /**总数统计**/
        $data              = [];
        $data['list']      = $list ?? [];
        $data['statisticsData'] = $statisticsData;
        $data['dataCount'] = $dataCounts ?? 0;
        dd($data);
        return $data;
    }

}